package com.yanqu.road.entity.activity.biaoju.config;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.utils.string.StringUtils;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

@FieldTypeAnnotation(tableName = "t_s_activity_biaoju_dart", desc = "镖局押镖配置表")
public class BiaoJuDartConfig extends DataObject {
    @FieldTypeAnnotation(select = true, isIndex = true)
    private int activityId;
    @FieldTypeAnnotation(desc = "镖单id", isIndex = true)
    private int id;
    @FieldTypeAnnotation(desc = "镖单名称")
    private String name;
    @FieldTypeAnnotation(desc = "镖单介绍")
    private String desc;
    @FieldTypeAnnotation(desc = "图标")
    private String icon;
    @FieldTypeAnnotation(desc = "品质")
    private int quality;
    @FieldTypeAnnotation(desc = "档次（1普通，2优秀，3卓越，4传奇，5无双）")
    private int gear;
    @FieldTypeAnnotation(desc = "怪物战力")
    private String monsterPower;
    @FieldTypeAnnotation(desc = "怪物出现时间点（配千分比）")
    private String monsterTime;
    @FieldTypeAnnotation(desc = "权重")
    private int weights;
    @FieldTypeAnnotation(desc = "结算-押镖经验(完标)")
    private int incomeScoreSuccess;
    @FieldTypeAnnotation(desc = "结算-押镖经验(半标)")
    private int incomeScoreHalf;
    @FieldTypeAnnotation(desc = "结算-押镖经验(失标)")
    private int incomeScoreFail;
    @FieldTypeAnnotation(desc = "结算-押镖赏金(完标)")
    private int incomeBountySuccess;
    @FieldTypeAnnotation(desc = "结算-押镖赏金(半标)")
    private int incomeBountyHalf;
    @FieldTypeAnnotation(desc = "结算-押镖赏金(失标)")
    private int incomeBountyFail;

    private List<Integer> monsterTimeList = new ArrayList<>();
    private List<Integer> monsterPowerList = new ArrayList<>();

    public BiaoJuDartConfig(ResultSet rs) throws SQLException {
        this.activityId = rs.getInt("activityId");
        this.id = rs.getInt("id");
        this.name = rs.getString("name");
        this.desc = rs.getString("desc");
        this.icon = rs.getString("icon");
        this.quality = rs.getInt("quality");
        this.gear = rs.getInt("gear");
        this.monsterPower = rs.getString("monsterPower");
        this.monsterTime = rs.getString("monsterTime");
        this.weights = rs.getInt("weights");
        this.incomeScoreSuccess = rs.getInt("incomeScoreSuccess");
        this.incomeScoreHalf = rs.getInt("incomeScoreHalf");
        this.incomeScoreFail = rs.getInt("incomeScoreFail");
        this.incomeBountySuccess = rs.getInt("incomeBountySuccess");
        this.incomeBountyHalf = rs.getInt("incomeBountyHalf");
        this.incomeBountyFail = rs.getInt("incomeBountyFail");

        this.monsterTimeList = StringUtils.stringToIntegerList(this.monsterTime, "\\|");
        this.monsterPowerList = StringUtils.stringToIntegerList(this.monsterPower, "\\|");
    }

    public int getActivityId() {
        return activityId;
    }

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getDesc() {
        return desc;
    }

    public String getIcon() {
        return icon;
    }

    public int getQuality() {
        return quality;
    }

    public String getMonsterPower() {
        return monsterPower;
    }

    public String getMonsterTime() {
        return monsterTime;
    }

    public int getWeights() {
        return weights;
    }

    public int getIncomeScoreSuccess() {
        return incomeScoreSuccess;
    }

    public int getIncomeScoreHalf() {
        return incomeScoreHalf;
    }

    public int getIncomeScoreFail() {
        return incomeScoreFail;
    }

    public int getIncomeBountySuccess() {
        return incomeBountySuccess;
    }

    public int getIncomeBountyHalf() {
        return incomeBountyHalf;
    }

    public int getIncomeBountyFail() {
        return incomeBountyFail;
    }

    public List<Integer> getMonsterTimeList() {
        return monsterTimeList;
    }

    public List<Integer> getMonsterPowerList() {
        return monsterPowerList;
    }

    public int getGear() {
        return gear;
    }
}
